﻿@using Orchard.ContentManagement;

@{
    var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}

<div class="log-on">
    <h1>@Html.TitleForPage((string)Model.Title)</h1>
    <div id="content">
    <p>
        <h3 class="reply">@T("Please enter your username and password.")</h3>
        @if(userCanRegister) { @Html.ActionLink(T("Register").Text, "Register") @T(" if you don't have an account.") }
        @if(enableLostPassword) { @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
    </p>
    @Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())

    @using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { id = "loginform" }))
    {
    <div class="postinput">
        <p>
            <label for="username-email"><small>@T("Username")</small></label>
            <input type="text" name="userNameOrEmail" class="comment"/>
            @Html.ValidationMessage("userNameOrEmail")
        </p>
        <p>
            <label for="password"><small>@T("Password")</small></label>
            <input type="password" name="password" class="comment"/>
            @Html.ValidationMessage("password")
        </p>
        <button class="button" type="submit"><span>@T("Sign In")</span></button>
    </div>
    }
    </div>
</div>